linux: fix condition for entering tickless state
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 9 Mar 2007 18:30:52 +0000 (18:30 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 9 Mar 2007 18:30:52 +0000 (18:30 +0000)
I noticed that timer interrupts were running at full rate regardless
of whether the system was idle.
softlockup_get_next_event() must return the maximum of zero and the
delta to the next event, not the minimum (which is always zero or
negative, yielding zero or a very large positive number as return
value).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
patches/linux-2.6.18/softlockup-no-idle-hz.patch

index 6799bfc4bfdaeafe035f21f0919309b5c35c9235..d98edac8f278512a819fe642413114b2f4bbdfb8 100644 (file)
@@ -34,7 +34,7 @@ diff -pruN ../orig-linux-2.6.18/kernel/softlockup.c ./kernel/softlockup.c
 +                      !per_cpu(watchdog_task, this_cpu))
 +              return MAX_JIFFY_OFFSET;
 +
-+      return min_t(long, 0, touch_timestamp + HZ - jiffies);
++      return max_t(long, 0, touch_timestamp + HZ - jiffies);
 +}
 +
  /*